package cn.User;

import cn.operate.*;

import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-24
 * Time:14:11
 */
public class NormalUser extends User{
   public NormalUser(String name)
    {
        super(name);
        this.ioPerations=new IOPeration[]{new ReturnOperation(), new FindOperation(),new BorrowOperation(),new BackOperation()};
    }

    @Override
    public int menu() {
        System.out.println("**************读者菜单**************");
        System.out.println("*****1.查找图书     2.借阅图书********");
        System.out.println("*****3.归还图书     0.退出系统********");
        System.out.println("***********************************");
        Scanner sc=new Scanner(System.in);
        System.out.println("你的选择——> ");
        int choice=sc.nextInt();
        while(true) {
            if (choice >= 4) {
                System.out.println("输入错误,重新选择");
                choice=sc.nextInt();
            }
            else break;

        }
        return choice;
    }

}
